package com.jyh.fanxing;

import java.util.Deque;
import java.util.LinkedList;

/**
 * @Author JYH
 * @Date 2024/7/31 16:22
 * @Description
 */
public class Lx1 {
    public static void main(String[] args) {
        //创建栈的对象
        Deque<Integer> deque = new LinkedList<>();
        //栈对象调用方法
        deque.push(1);
        deque.push(2);
        deque.push(3);
        System.out.println("deque = " + deque);//[3,2,1]
        Integer pop = deque.pop();
        System.out.println("pop = " + pop);//3
        System.out.println(deque);//[2,1]

        deque.push(100);
        System.out.println(deque);//[100,2,1]

        Integer peek = deque.peek();
        System.out.println("peek = " + peek);
        System.out.println(deque);


    }
}
